/*
 * CS_SOCIAL_FRIEND_LIST_INFO.cpp
 *
 *  Created on: 2013. 10. 11.
 *      Author: the2
 */

#include "../../Command.h"
#include "../../User.h"
#include "../../Proxy.h"
#include "../../../../protocol/iFriends.h"

namespace ProjectZ { namespace NCommand {

void Command::CS_SOCIAL_FRIEND_LIST_INFO(User * pUser, ::Network::Packet * pPacket)
{
	PREPARE_PACKET;

	uint16_t count = 0;
	*pPacket >> count;

	if(100 < count)
	{
		::Network::Packet * pAck = ::Network::GETPACKETPOOL()->SEND_NEW();
		pAck->MsgCat("%2d%c", ACK_UNKNOWN_ERROR, 0);
		pAck->MakePacket(CMD_SC_SOCIAL_FRIEND_LIST_INFO);
		pUser->Send(pAck);
		return;
	}

	SocialFriendsSyn msg;
	for(int i=0; i < count; i++)
	{
		uint32_t userseq = 0;
		*pPacket >> userseq;

		msg.userseq.push_back(userseq);
	}

	::ProjectZ::NProxy::SendFriendsServer(pUser->GetUserSeq(), msg);
}

} /*NCommand*/ } /*ProjectZ*/



